package com.bharatonjava.hospital.dao.rowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.bharatonjava.hospital.domain.Address;

public class AddressRowMapper implements RowMapper<Address>{

	@Override
	public Address mapRow(ResultSet rs, int rownum) throws SQLException {
		Address a = new Address();
		a.setAddressId(rs.getLong("address_id"));
		a.setPatientId(rs.getLong("patient_id"));
		a.setStreet(rs.getString("street"));
		a.setBuilding(rs.getString("building"));
		a.setCity(rs.getString("city"));
		return a;
	}

}
